package com.jackie.easyble.ui.adapter

import android.content.Context
import android.os.ParcelUuid
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.DataBindingHolder
import com.jackie.easyble.R
import com.jackie.easyble.databinding.AdapterScanRecordUuidBinding

/**
 * 广播包解析-AD结构适配器列表
 */
class ScanRecordUuidRecyclerViewAdapter :
    BaseQuickAdapter<ParcelUuid, ScanRecordUuidRecyclerViewAdapter.ViewHolder>() {

    class ViewHolder(parent: ViewGroup) :
        DataBindingHolder<AdapterScanRecordUuidBinding>(
            R.layout.adapter_scan_record_uuid,
            parent
        )

    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     *
     * 实现方法
     *
     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

    override fun onBindViewHolder(holder: ViewHolder, position: Int, item: ParcelUuid?) {
        holder.binding.uuid = item
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): ViewHolder {
        return ViewHolder(parent)
    }
}